#include "TheirKickInBehaviour.h"


/*
 *	toto spravanie sa vykona, ked ma super vhadzovanie
 *
 */
void TheirKickInBehaviour::Behave()
{
	if(DATA_STORAGE.ballPosition.GetY() < 0)
	{
		if(DATA_STORAGE.myUniform == 3)
		{
			GetRunToPositionBehaviour()->Behave(Point(DATA_STORAGE.ballPosition.GetX() - 15, DATA_STORAGE.ballPosition.GetY() + 15), 2);
			return;
		}
		else if(DATA_STORAGE.myUniform == 5)
		{
			GetRunToPositionBehaviour()->Behave(Point(DATA_STORAGE.ballPosition.GetX(), DATA_STORAGE.ballPosition.GetY() + 15), 2);
			return;
		}
		else if(DATA_STORAGE.myUniform == 10)
		{
			GetRunToPositionBehaviour()->Behave(Point(DATA_STORAGE.ballPosition.GetX() + 15, DATA_STORAGE.ballPosition.GetY() + 15), 2);
			return;
		}
		else
		{
			DATA_STORAGE.ignoreBall = true;
		}
	}
	else if(DATA_STORAGE.ballPosition.GetY() > 0)
	{
		if(DATA_STORAGE.myUniform == 4)
		{
			GetRunToPositionBehaviour()->Behave(Point(DATA_STORAGE.ballPosition.GetX() - 15, DATA_STORAGE.ballPosition.GetY() - 15), 2);
			return;
		}
		else if(DATA_STORAGE.myUniform == 5)
		{
			GetRunToPositionBehaviour()->Behave(Point(DATA_STORAGE.ballPosition.GetX(), DATA_STORAGE.ballPosition.GetY() - 15), 2);
			return;
		}
		else if(DATA_STORAGE.myUniform == 11)
		{
			GetRunToPositionBehaviour()->Behave(Point(DATA_STORAGE.ballPosition.GetX() + 15, DATA_STORAGE.ballPosition.GetY() - 15), 2);
			return;
		}
		else
		{
			DATA_STORAGE.ignoreBall = true;
		}
	}
}
